var index = {
    userInfo: null,
    URL: {
        getUserInfoUrl: "/api/userInfo/getUserInfo",
    },
    detail: {
        checkLogin: function () {
            $.post(login.URL.checkLoginUrl, {}, function (data) {
                if (!data.hasError) {
                    index.userInfo = data.object;
                    if (index.userInfo.regFlag == 0) {
                        window.location.href = "info.html";
                    }
                    $.pop.load(false, null);
                } else {
                    window.location.href = data.errUrl;
                }
            }, "json").error(function (XMLHttpRequest, textStatus, errorThrown) {
                $.pop.load(false, null);
                $.pop.tips("系统繁忙，请稍后" + XMLHttpRequest.status + "," + XMLHttpRequest.readyState + "," + textStatus);
            });
        },
        toInfo: function () {
            if (index.userInfo.regFlag==0){
                window.location.href="info.html";
            }else{
                window.location.href="info_look.html";
            }
        },
        toQues:function () {
          if (index.userInfo.quesStatus == 0){
              window.location.href="questionnaire.html";
          }else {
              $.pop.tips("问卷已提交");
          }
        },
        showTip: function () {
            $.pop.tips("正在准备中");
        }
    }
}